package hao.bk.royalmap;

import android.content.Context;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import hao.bk.royalmap.R;


public class SlidingMenuGeneralLayout extends RelativeLayout implements
		OnClickListener {

	private RoyalMapActivity main;
	public LinearLayout publicTransportLnl,publicPromotionlnl, publicWeblnl,
		lookingVehicleLnl, publicBackuplnl;
	public Button goneMenu;
	public SlidingMenuGeneralLayout(Context context) {
		super(context);
		main = (RoyalMapActivity) context;
		inflate(main, R.layout.slide_menu, this);
		publicPromotionlnl = (LinearLayout)findViewById(R.id.public_promotion_lnl);
		publicPromotionlnl.setOnClickListener(this);
		publicWeblnl = (LinearLayout)findViewById(R.id.public_web_lnl);
		publicWeblnl.setOnClickListener(this);
		publicTransportLnl = (LinearLayout)findViewById(R.id.public_transport_lnl);
		publicTransportLnl.setOnClickListener(this);
		publicBackuplnl = (LinearLayout)findViewById(R.id.public_backup_lnl);
		lookingVehicleLnl = (LinearLayout)findViewById(R.id.looking_vehicle_lnl);
		lookingVehicleLnl.setOnClickListener(this);
		publicBackuplnl.setOnClickListener(this);
		goneMenu = (Button)findViewById(R.id.gone_menu);
		goneMenu.setOnClickListener(this);
	}

	@Override
	public void onClick(View v) {
		// TODO Auto-generated method stub
		switch (v.getId()) {
			case R.id.public_promotion_lnl:
				// show listView thông tin khuyến mãi
				main.flagViewMap = true;
				main.showPromotion();
				break;
			case R.id.public_web_lnl:
				// hiển thị web trang chủ 
				main.flagViewMap = true;
				//main.goneMenu();
				main.showWebRoyal();
				break;
			case R.id.public_transport_lnl:
				main.showPublicTransport();
				break;
			case R.id.public_backup_lnl:
				//show phản hồi ứng dụng
				main.flagViewMap = true;
				main.showFeedBack();
				break;
			case R.id.gone_menu:
				main.flagViewMap = true;
				main.goneMenu();
				break;	
			case R.id.looking_vehicle_lnl:
				
				main.showLookingVehicle();
				break;
			default:
				break;
		}
	}
	
}
